package com.lb.design.pattern.stratery;

import org.springframework.stereotype.Service;

@Service
public class PaymentService {

    private final PaymentFactory paymentFactory;

    public PaymentService(PaymentFactory paymentFactory) {
        this.paymentFactory = paymentFactory;
    }

    public void pay(String type, double amount) {
        paymentFactory.getStrategy(type).pay(amount);
    }
}